ngl: Fix a rounding error in subpixel positioning
authorMatthias Clasen <mclasen@redhat.com>
Sat, 20 Mar 2021 03:18:43 +0000 (23:18 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 21 Mar 2021 20:05:10 +0000 (16:05 -0400)
1024 / 4 is 256, not 250.

gsk/ngl/gsknglglyphlibrary.c

index 502bf01e267e7e52b2a89228aef18d6518889c1a..2179a804d70d9eb120280401a553ed31758b5cf8 100644 (file)
@@ -176,10 +176,10 @@ render_glyph (cairo_surface_t           *surface,
   glyph_info.glyph = key->glyph;
   glyph_info.geometry.width = value->ink_rect.width * 1024;
   if (glyph_info.glyph & PANGO_GLYPH_UNKNOWN_FLAG)
-    glyph_info.geometry.x_offset = 250 * key->xshift;
+    glyph_info.geometry.x_offset = 256 * key->xshift;
   else
-    glyph_info.geometry.x_offset = 250 * key->xshift - value->ink_rect.x * 1024;
-  glyph_info.geometry.y_offset = 250 * key->yshift - value->ink_rect.y * 1024;
+    glyph_info.geometry.x_offset = 256 * key->xshift - value->ink_rect.x * 1024;
+  glyph_info.geometry.y_offset = 256 * key->yshift - value->ink_rect.y * 1024;
 
   glyph_string.num_glyphs = 1;
   glyph_string.glyphs = &glyph_info;